<div class="mainset">
    <div class="nav">
        <a href="#admin/mainset">
            <div class="nav-li">轮播设置</div>
        </a>
        <div class="nav-li focus">公告栏设置</div>
    </div>
    <hr />
    <div class="info_box">
        <div class="preview">
            <p>公告栏预览：</p>
            <noticebox data-key="bus_loginer.config.notices"></noticebox>
        </div>
        <div class="addbox">
            <p>
                <h5>编辑公告：</h5>
            </p>
            {{#each bus_loginer.config.notices}}
            <div class="noticeitem">
                {{#if $Private.$Cache.editing}}
                <div class="editor">
                    <div>
                        公告文字：
                        <input class="notice" type="text" placeholder="请输入内容，不超过100字" value="{{content}}" bind-input="{{'content'}}" readonly="{{!$Private.$Cache.editing}}" />
                    </div>
                    <br />
                    <div>
                        公告链接：
                        <input class="notice" type="text" placeholder="请输入文字链接" value="{{url}}" bind-input="{{'url'}}" readonly="{{!$Private.$Cache.editing}}" />
                    </div>
                </div>
                <button event-click="{{'$Top.$Event.admin.notices.put_update'}}" class="edit">提交</button>
                <button event-click="{{'$Top.$Event.admin.notices.cancel_update'}}" class="edit">取消</button>
                {{#else}}
                <div class="notice" title="{{content}}"><a style="color:#333;" target="_blank" href="{{url||'javascript:false;'}}">{{content}}</a>
                </div>
                <button event-click="{{'$Top.$Event.admin.notices.to_update'}}" class="edit">修改</button>
                {{/if}}
                <button event-click="{{'$Top.$Event.admin.notices.remove'}}" class="edit">移除</button>
            </div>
            {{/each}}
        </div>
        <div>
            公告文字：
            <input class="noticeadd" type="text" placeholder="请输入内容，不超过100字" value="{{$Cache.admin.notices.content}}" bind-input="{{'$Cache.admin.notices.content'}}" />
            <br />
            <br />
            公告链接：
            <input class="noticeadd" type="text" placeholder="请输入内容，不超过100字" value="{{$Cache.admin.notices.url}}" bind-input="{{'$Cache.admin.notices.url'}}" />
            <br/>
            <div>
                (例：http://www.baidu.com)
            </div>
            <br/>
        </div>
        <button event-click="{{'$Event.admin.notices.add'}}" class="icon-plus">增加公告</button>
    </div>
</div>
